Kafka Learning (1) configuration and simple command usage, kafka learning configuration command1. Introduction to related concepts in Kafka
Kafka is a distributed message middleware implemented by scala. The related concepts are a
Introduced
Kafka is a distributed, partitioned, replicable messaging system. It provides the functionality of a common messaging system, but has its own unique design. What does this unique design look like?
Let's first look at a few basic messaging system terms:
Kafka the message to topic as a unit.• The program that will release the message to Kafka topic be
Description
Operating system: CentOS 6.x 64-bit
Kafka version: kafka_2.11-0.8.2.1
To achieve the purpose:
Stand-alone installation Configuration Kafka
Specific actions:
First, close SELinux, open firewall 9092 port
1. Close SELinux
Vi/etc/selinux/config
#SE
/zookeeper.propertiesdataDir=/usr/local/kafka/zookeeperclientPort=2181maxClientCnxns=0
4. Compile the Kafka startup and shell close scripts
cat/etc/init.d/kafka#!/bin/bashsource/etc/profile;functionStop(){ps-ef|grepkafka|grep-vgrep|awk‘{print$2}‘|xargskill-9}functionStart(){/bin/bash/usr/local/kafka/bin/zookeeper-serv
Getting Started with Apache Kafka
In order to facilitate later use, the recording of their own learning process. Because there is no production link use of experience, I hope that experienced friends can leave message guidance.
The introduction of Apache Kafka is probably divided into 5 blogs, the content is basic, the plan contains the following content: Kafka b
/643043e9-08d4-3402-9471-4c4adaaba323.png "/>Can see, metadata in the cluster information, the node hostname is iz25wuzqk91z such a string of numbers, rather than the actual IP address 10.0.0.100 and 101. IZ25WUZQK91Z is actually the hostname of the remote host, This means that without the configuration of Advertised.host.name, Kafka did not broadcast the host.name that we configured, as the official docume
In the previous section (Point this transfer), we completed the Kafka cluster, in this section we will introduce the new API in version 0.9, and the test of Kafka cluster high availability1. Use Kafka's producer API to complete the push of messages1) Kafka 0.9.0.1 Java Client dependency:2) Write a Kafkautil tool class to construct the
:2181,192.168.79.139:2181-- From-beginning
--zookeeper represents the ZK address of the Kafka cluster
--from-beginning said that in the past, the start of the consumer production before the message can also be consumed
The last subject marked for deletion can also be consumed
File parameter configuration
Broker,server.propertie
1. Producer production sends a message that the broker cache data reaches a ce
First, Kafka use the background
There are a number of issues that can be encountered when using distributed databases and distributed computing clusters:
Need to analyze user behavior (pageviews);
The user's search keywords are counted to analyze the current trends
Some data, storage database waste, direct storage drive efficiency and low
These scenarios have one thing in common:
Data is generated by the upstream module, upstream module, using the up
Kafka Learning (1) configuration and simple command usage
1. Introduction to related concepts in Kafka is a distributed message middleware implemented by scala. the concepts involved are as follows:
The content transmitted in Kafka is called message. The relationship between topics and messages that are grouped by top
,不易过大zookeeper.connection.timeout.ms=6000ZooKeeper的连接超时时间zookeeper.sync.time.ms=2000ZooKeeper集群中leader和follower之间的同步时间
Here the main changes under Zookeeper.connect for the ZK Cluster service address, such as:zookeeper.connect=bluejoe1:2181,bluejoe2:2181,bluejoe3:21814. SCP to other nodes, such as: Bluejoe2,bluejoe35. Under the Kafka deployment directory, start with the following command on each node:$ bin/
1. Download the latest Kafka from Kafka website, current version is 0.9.0.12. After downloading, upload to the Linux server and unzipTar-xzf kafka_2.11-0.9.0.1.tgz3. Modify the Zookeeper server configuration and startCD Kafka_2.11-0.9.0.1vi config/zookeeper.properties #修改ZooKeeper的数据目录dataDir =/opt/favccxx/db/zookeeper# Configure Host.name and Advertised.host.nam
evaluation. Or Try:help.Scala> : Quitc:\users\zyx>1.3.4. Thriftc:\users\zyx>thrift-versionThrift version 0.11.01.3.5. Zookeeper1.3.5.1. ConfigurationIn the D:\Project\ServiceMiddleWare\zookeeper-3.4.10\conf directory, create a zoo.cfg file that reads as followsticktime=2000datadir=d:/project/servicemiddleware/zookeeper-3.4.10/data/dbDatalogdir=d:/project/servicemiddleware/zookeeper-3.4.10/data/logclientport=2181# Zookeeper Cluster# server.1=127.0.0.1:12888:1388# server.2=127.0.0.1:12889:1389# s
Environment Description:
Os:ubuntu 16.04
Zookeeper:zookeeper 3.4.9
kafka:kafka_2.11-0.11.0.0
JDK:JDK 8 (Kafka boot required to use to JDK)
Detailed instructions (all of the following actions are done under root user):One, JDK installationThe JDK is divided into the following categories: JRE, OPENJDK, Oracle JDK, where we install Oracle JDK (recommended installation)Add-apt-repository ppa:webupd8team/javaapt-get updateapt-get
--topic kafkatopic--replication-factor 1--partitions 1--zookeeper localhost:2181 5) Start up the Kafka producers:Ademacbook-pro:bin apple$ sh kafka-console-producer.sh--broker-list localhost:9092 --sync--topic kafkatopicNote: To be hung in the background use:SH kafka-console-producer.sh--broker-list localhost:9092--sync--topic kafkatopic 6) Open another terminal
Kafka provides a number of configuration parameters for Broker,producer and consumer. Understanding and understanding these configuration parameters is very important for us to use Kafka.Official Address: ConfigurationThe configuration file server.properties in each Kafka br
synchronization is complete.ClientPort: Listen for the service port of the client connection, if you have multiple zookeeper servers installed on one server, you need to set a different port number.DataDir: Memory Database snapshot address, transaction log address (unless otherwise specified by Datalogdir).2. Create a new file myID under $datadir and write to the server identification number#/tmp/zookeeper to DataDircd/tmp/zookeeper/sudo vim myID#在myid中添加服务器标识号Start Stop#进入 $ZOOKEEPER _home, ru
Kafka configuration optimizations are actually modifying the parameter values in the Server.properties file1. Network and IO operation thread Configuration optimization # The maximum number of threads the broker processes messagesNum.network.threads=xxx# Number of threads that broker handles disk IONum.io.threads=xxxRecommended configuration:General num.network.t
Kafka provides a number of configuration parameters for Broker,producer and consumer. Understanding and understanding these configuration parameters is very important for us to use Kafka.This article lists some of the important configuration parameters.The Official document configu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.